<?php

#$db->getProfiler()->clear();

#$product = new Product(1);
#$product->setQuantity(50);
#$product->setAttribute(1, 'Letterpress');
#$product->setAttribute(2, 'Two');
#$product->setSimpleAttribute(4, '552 - Merlot (Wide Satin - 15mm width)');

if ($_SERVER['REQUEST_METHOD'] == 'POST' and isset($_REQUEST['line'])) {
	foreach($_REQUEST['line'] as $line_id => $quantity) {
		$basket->set($line_id, $quantity);
	}
}

$smarty->assign('basket', $basket->export());


#echo "<pre>";
#echo "Setup price: {$product->getSetupPrice()}\n";
#echo " Price each: {$product->getPrice()}\n";
#echo "   Quantity: {$product->quantity}\n";
#echo "   Ex Setup: ", $product->quantity*$product->getPrice(), "\n";
#echo "Total price: {$product->getTotalPrice()}\n";
#echo "\n\n\n";
#echo "</pre>";


#$smarty->assign('attributes', $product->attributes());
#$smarty->assign('simpleAttributes', $product->simpleAttributes());
#$smarty->assign('price', $product->getPrice());
#$smarty->assign('quantity', $product->getQuantity());



$smarty->display('shop/basket.tpl.html');
